package mrHunter;

import java.util.HashMap;
import java.util.Map;

public class ProblemInf {
    private int no;
    private String name;
    private String diff;
    private String type;
    private String[] inputType;
    private String[] outputType;
    private String[] inputInf;
    private String[] outputInf;
    private int inputNum;
    private int outputNum;
    private Map<String,String> inputsAndOutputs;
    private int submit;

    public ProblemInf(){}

    public ProblemInf(int no, String name, String diff, String type){
        this.no=no;
        this.name=name;
        this.diff=diff;
        this.inputsAndOutputs=new HashMap<>();
        this.inputType=new String[inputNum];
        this.outputType=new String[outputNum];
    }

    public ProblemInf(int no, String name, String diff,String inputType,String outputType,String inputs, String outputs,String type,int inputNum,int outputNum,String inputInf, String outputInf, int submit){
        this.no=no;
        this.name=name;
        this.diff=diff;
        this.type=type;
        //TODO:Initialize inputsAndOutputs
        this.inputsAndOutputs=new HashMap<>();
        if(null!=inputs&&null!=outputs){
            String[] inputArray=inputs.split(";");
            String[] outputArray=outputs.split(";");
            for(int i=0;i<inputArray.length&&i<outputArray.length;i++){
                this.inputsAndOutputs.put(inputArray[i],outputArray[i]);
            }
        }
        this.inputNum=inputNum;
        this.outputNum=outputNum;
        this.inputType=inputType.split(";");
        this.outputType=outputType.split(";");
        this.inputInf=inputInf.split(";");
        this.outputInf=outputInf.split(";");
        this.submit=submit;
    }

    public void setNo(int no){this.no=no;}

    public int getNo(){return no;}

    public void setName(String name){this.name=name;}

    public String getName(){return name;}

    public void setDiff(String diff){this.diff=diff;}

    public String getDiff(){return diff;}


    public Map<String, String> getInputsAndOutputs() {
        return inputsAndOutputs;
    }

    public void setInputsAndOutputs(Map<String, String> inputsAndOutputs) {
        this.inputsAndOutputs = inputsAndOutputs;
    }

    public String[] getInputType() {
        return inputType;
    }

    public String[] getOutputType() {
        return outputType;
    }

    public void setInputType(String[] inputType) {
        this.inputType = inputType;
    }

    public void setOutputType(String[] outputType) {
        this.outputType = outputType;
    }

    public String getType() { return type; }

    public void setType(String type) { this.type = type; }

    public int getInputNum() {
        return inputNum;
    }

    public void setInputNum(int inputNum) {
        this.inputNum = inputNum;
    }

    public int getOutputNum() {
        return outputNum;
    }

    public void setOutputNum(int outputNum) {
        this.outputNum = outputNum;
    }

    public String[] getInputInf() {
        return inputInf;
    }

    public String[] getOutputInf() {
        return outputInf;
    }

    public void setInputInf(String[] inputInf) {
        this.inputInf = inputInf;
    }

    public void setOutputInf(String[] outputInf) {
        this.outputInf = outputInf;
    }

    public int getSubmit() {
        return submit;
    }

    public void setSubmit(int submit) {
        this.submit = submit;
    }
}
